package com.yuyou.activity.comm.service;

import org.springframework.core.env.Environment;

import com.yuyou.activity.util.util.SpringUtil;

public class PayConfig  {


	private String noticeCreateOrderUrl;
	
	private String noticeRefundOrderUrl;
			
	public PayConfig(String noticeCreateOrderUrl, String noticeRefundOrderUrl) {
		super();
		this.noticeCreateOrderUrl = noticeCreateOrderUrl;
		this.noticeRefundOrderUrl = noticeRefundOrderUrl;
	}

	public PayConfig() {
		super();
	}

	public String getNoticeCreateOrderUrl() {
		return noticeCreateOrderUrl;
	}

	public void setNoticeCreateOrderUrl(String noticeCreateOrderUrl) {
		this.noticeCreateOrderUrl = noticeCreateOrderUrl;
	}

	public String getNoticeRefundOrderUrl() {
		return noticeRefundOrderUrl;
	}

	public void setNoticeRefundOrderUrl(String noticeRefundOrderUrl) {
		this.noticeRefundOrderUrl = noticeRefundOrderUrl;
	}

	private static PayConfig config=null;

	public static PayConfig getConfig(String project){
		if(config==null){
			config=new PayConfig();
			Environment env=(Environment)SpringUtil.getBean("environment");
			String noticeCreateOrderUrl=env.getProperty(project+"_notice_create_order_url");
			String noticeRefundOrderUrl=env.getProperty(project+"_notice_refund_order_url");
			config.setNoticeCreateOrderUrl(noticeCreateOrderUrl);
			config.setNoticeRefundOrderUrl(noticeRefundOrderUrl);
		}
		return config;

	}
	


}
